/*package com.sunjy.common.utils;


import java.util.Calendar;

*//**
 * IdGenerator工具类
 * Created by zhouyao on 2017/5/22.
 *//*
public class IdGenerator {
	
	private IdGenerator() {}
	
	private static String getTimeBasedPrefix(){
		Calendar calTarget = Calendar.getInstance();
		int year = (calTarget.get(Calendar.YEAR));
		int month = calTarget.get(Calendar.MONTH) + 1;
		int day = calTarget.get(Calendar.DAY_OF_MONTH);
		int hour = calTarget.get(Calendar.HOUR_OF_DAY);
		int minute = calTarget.get(Calendar.MINUTE);
		int second = calTarget.get(Calendar.SECOND);
		String timeBasedPrefix = String.format("%04d%02d%02d%02d%02d%02d", year, month, day, hour, minute, second);
		return timeBasedPrefix;
	}
    
	*//**
	 * 交易流水号28位 [构成：系统编号2位+时间14位+随机10位+业务类型2位]
	 * @param systemNoEnum
	 * @param serviceTypeEnum
	 * @return
	 *//*
	public static  String genTransactionFlowNumberString(TransactionFlow.SystemNoEnum systemNoEnum, TransactionFlow.ServiceTypeEnum serviceTypeEnum) {
		String systemNo = systemNoEnum.getCode();
		String timeBasedPrefix = getTimeBasedPrefix();
		String randomNum = RandomUtils.genLenNumber(10);
		String serviceType = serviceTypeEnum.getCode();
		StringBuilder sbJpql = new StringBuilder();
		String transNo = sbJpql.append(systemNo).append(timeBasedPrefix).append(randomNum).append(serviceType).toString();
		return transNo;
	}

	*//**
	 * 订单号25位 [构成：用户企业1位+渠道2位+时间14位+随机6位+业务代码2位]
	 * @param userEnterpriseEnum
	 * @param channelEnum
	 * @param socialServiceCodeEnum
	 * @return
	 *//*
	public static  String genOrderNo(UserEnterpriseEnum userEnterpriseEnum, ChannelEnum channelEnum, SocialServiceCodeEnum socialServiceCodeEnum) {
		String userEnterprise = userEnterpriseEnum.getCode();
		String channel = channelEnum.getCode();
		String timeBasedPrefix = getTimeBasedPrefix();
		String randomNum = RandomUtils.genLenNumber(6);
		String socialServiceCode = socialServiceCodeEnum.getCode();
		StringBuilder sbJpql = new StringBuilder();
		String orderNo = sbJpql.append(userEnterprise).append(channel).append(timeBasedPrefix).append(randomNum).append(socialServiceCode).toString();
		return orderNo;
	}
	
	public static void main(String[] args) {
		System.out.println(Integer.MAX_VALUE);
		while(true){
			String transNo = IdGenerator.genTransactionFlowNumberString(SystemNoEnum.ALIPAY, ServiceTypeEnum.PAY);
			String orderNo = IdGenerator.genOrderNo(UserEnterpriseEnum.USER, ChannelEnum.ALIPAY, SocialServiceCodeEnum.SOCIAL_ACCUMULATION);
		    System.out.println(transNo.length() + "===28位交易流水号：" + transNo);
		    System.out.println(orderNo.length() + "======25位订单号：" + orderNo);
		}
	}

}*/
